package me.zhengjie.inter.rest;

import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import lombok.RequiredArgsConstructor;
import me.zhengjie.annotation.Log;
import me.zhengjie.aop.annotation.BisLog;
import me.zhengjie.business.domain.AdlZhsq;
import me.zhengjie.business.domain.Zhsq;
import me.zhengjie.business.service.AdlXmxxService;
import me.zhengjie.business.service.AdlZhsqService;
import me.zhengjie.inter.service.MpAdlZhsqService;
import me.zhengjie.utils.PageUtil;
import org.springframework.http.HttpStatus;
import org.springframework.http.ResponseEntity;
import org.springframework.validation.annotation.Validated;
import org.springframework.web.bind.annotation.*;

import javax.servlet.http.HttpServletRequest;
import java.util.Map;

/**
 * @author xiahongbo
 * @date 2022-07-10
 **/
@RestController
@RequiredArgsConstructor
@Api(tags = "移动端ADL量表记录项目表")
@RequestMapping("/mp/adlZhsq")
public class MpAdlZhsqController {

    private final MpAdlZhsqService adlZhsqService;

    @PostMapping("/save")
    @Log("移动端新增ADL量表评估记录")
    @ApiOperation("移动端新增ADL量表评估记录")
    public ResponseEntity<Object> createZhsq(@Validated @RequestBody AdlZhsq resources, @RequestParam String ids, HttpServletRequest request){

        return new ResponseEntity<>(PageUtil.toMpContent(adlZhsqService.create(resources, ids)), HttpStatus.CREATED);
    }
}
